﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Cwjk_Export.aspx.vb"	 Inherits="PubProject.Cwjk_Export" %>   
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>导出账套</title>
	<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
	<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
	<meta name="vs_defaultClientScript" content="JavaScript">
	<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
	<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
	<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
	<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
	<link rel="stylesheet" type="text/css" href="/_nav/tabs.css">
	<link rel="stylesheet" type="text/css" href="/_nav/nav.css">
	<link rel="stylesheet" type="text/css" href="/_common/styles/select.css">   
	<script language="javascript" src="/_controls/settings.aspx"></script>	  
	<script language="javascript" src="/_controls/setting.js"></script>	  
	<script language="javascript" src="/_controls/util/util.js"></script>     
	<script language="javascript" src="/_nav/menu.js"></script>		 
	<script language="javascript" src="/_common/scripts/global.js"></script>	
	<script language="javascript" src="/_controls/upfile/UpFile.js"></script> 
	<script language="javascript" src="/PubProject/js/Public.js"></script> 
	<script language="javascript" src="/PubProject/js/jquery.js"></script> 
	<script language="javascript">
		//在线帮助文件
	    var _MyHelpfile = "/Cbgl/HELP/topics/财务人员/设置财务接口/设置账套/导出账套设置.html";
		var strOldIsPost;
		// 初始化界面
		function window.onload() {
			appForm.setFormDefaultValue();
if( document.all("__Application") && document.all("__Application").value=="0101")
                {
                    _MyHelpfile = "/Slxt/HELP/topics/财务管理/财务接口设置/账套设置.html";
                }
		}		 

		//保存前调用的方法
		function oprBeforeSave() {    
			appForm.BuildXml();
		}

		//保存后调用的方法
		function oprAfterSave() {
			var xmlDom = new ActiveXObject("Microsoft.XMLDOM")	 
			try {
				xmlDom.loadXML(appForm.returnxml);

				if (xmlDom.documentElement.attributes.getNamedItem("result").value == "true") {
					var fileName = xmlDom.documentElement.attributes.getNamedItem("fileName").value;
					var fileUrl = xmlDom.documentElement.attributes.getNamedItem("fileUrl").value;
					if (fileName.length > 0 && fileUrl.length > 0) {
						OpenDownloadWin(fileName, fileUrl);
						window.close();
					}
					else {
						alert("生成账套文件有错，请重试！");
					}
				}
				event.returnValue = true;
				
			}
			catch (e) {
				alert("返回的xml格式错误，请与管理员联系！");
				return;
			}
		}   
	</script>

</head>
<body ms_positioning="GridLayout">
	<table class="layout" cellspacing="0" cellpadding="0">
		<colgroup>
			<col width="140">
			<!-- 导航菜单：140px -->
			<col>
		</colgroup>
		<tr height="25" id="trzc" >
			<td colspan="2">
				<!-- 菜单 -->
				<mnu:AppGridMenu id="appGridMenu" runat="server" />
			</td>
		</tr>
		<tr height="0" id="tr1" style="display: none">
			<td colspan="2">
				<!-- 菜单 -->
				<mnu:AppFormMenu ID="appFormMenu" runat="server"></mnu:AppFormMenu>
			</td>
		</tr>
		<tr>		
			<td colspan="2" id="tdAreas">
				<div class="main" id="areaForm">
					<cnt:AppForm ID="appForm" runat="server" DefaultValueXml="" ProcessType="xmlhttp"
						Assembly="Mysoft.Map.Core" InvokeClass="Mysoft.Map.Data.MyDB" InvokeFunction="SaveXml"
						OnBeforeSave="oprBeforeSave()" OnAfterSave="oprAfterSave()">
					</cnt:AppForm>
				</div>
			</td>
		</tr>
		<tr id="SaveTr" >
			<td class="buttons" style="height: 40px" colspan="2">
				<button onclick="$('#save').click()">
					确定</button>&nbsp;&nbsp;
				<button onclick="window.close();">
					取消</button>
			</td>
		</tr>
	</table>
	<form id="Form1" runat="server">
	</form>
</body>
</html>
